<?php

namespace App\Transformers\Admin;

use League\Fractal\TransformerAbstract;

class PermissionTransformer extends TransformerAbstract
{
    public function transform($permission)
    {
        return [
            'id' => $permission->id,
            'name' => $permission->name,
            'cn_name' => $permission->cn_name,
            'pid' => $permission->pid,
            'children' => $permission->children
        ];
    }
}
